﻿@using FH.Core
@model string

@*@functions {
    private bool TransientUpload
    {
        get
        {
            if (ViewData.ContainsKey("transientUpload"))
            {
                var x = ViewData["transientUpload"].Convert<bool>();
                return x;
            }
            return false;
        }
    }
}*@
@{
    var clientId = "picture" + ViewData.ModelMetadata.PropertyName;
}
<div data-picture id="@clientId" class="fileupload" style="display: inline-block;" data-upload-url='@Url.Action("Upload", "Common")'>

    @Html.HiddenFor(x => x, new { @class = "hidden" })

    <img src="@(string.IsNullOrEmpty(Model)?"/content/img/p0.jpg":Model)" class="img-polaroid" alt="" />

    @*<button class="btn remove"  @Html.Attr("style", "display:none", !Model.HasValue())>
        <i class="fa fa-trash-o"></i>
        删除
    </button>*@

    <span class="btn btn-primary fileinput-button">
        <i class="fa fa-upload"></i>
        <span>上传</span>
        <input id="fileupload-@ViewData.ModelMetadata.PropertyName" type="file" name="file" />
    </span>

    <button class="btn btn-warning cancel">
        <i class="fa fa-times"></i>
        <span>取消</span>
    </button>

    <!-- The global progress information -->
    <div class="span5 fileupload-progress fade">
        <!-- The global progress bar -->
        <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
            <div class="bar" style="width:0%;"></div>
        </div>
        <!-- The extended global progress information -->
        <div class="progress-extended">&nbsp;</div>
    </div>

</div>
